<?php
/**
 * author: JiangJun
 * CreateTime:2021/8/11 11:06 上午
 */

use Aws\Exception\AwsException;
use Aws\Sqs\SqsClient;

require './vendor/autoload.php';


$client = new SqsClient([
    'region' => 'us-west-2',
    'version' => '2012-11-05'
]);


try {
    $result = $client->createQueue(array(
        'QueueName' => 'love',
        'Attributes' => array(
            'ReceiveMessageWaitTimeSeconds' => 20 //设置轮询时长
        ),
    ));
    var_dump($result);
} catch (AwsException $e) {
    // output error message if fails
    error_log($e->getMessage());
}